﻿using System;

namespace SmartMotion.Core
{
    public class VarInfo:BindableBase
    {
        private string _group;
        private string _name;
        private string _type;
        private dynamic _initValue;
        private dynamic _value;

        private int _editPermission;
        private dynamic _min;
        private dynamic _max;
        private string _remark;

        /// <summary>
        /// 变量名称
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { SetProperty(ref _name, value); }
        }

        /// <summary>
        /// 全局唯一标识
        /// </summary>
        public string VarId { get; set; } = Guid.NewGuid().ToString();

        /// <summary>
        /// 变量分组
        /// </summary>
        public string Group
        {
            get { return _group; }
            set { SetProperty(ref _group, value); } 
        }
        /// <summary>
        /// 变量类型
        /// </summary>
        public string Type
        {
            get { return _type; }
            set { SetProperty(ref _type, value); }
        }
        /// <summary>
        /// 初始值
        /// </summary>

        public dynamic InitValue
        {
            get { return _initValue; }
            set { SetProperty(ref _initValue, value); }
        }
        /// <summary>
        /// 当前值
        /// </summary>
        public dynamic Value
        {
            get { return _value; }
            set { SetProperty(ref _value, value); }
        }
        /// <summary>
        /// 可以编辑的权限,用int可以比较权限大小
        /// </summary>
        public int EditPermission    
        {
            get { return _editPermission; }
            set { SetProperty(ref _editPermission, value); }
        }
        /// <summary>
        /// 最小值
        /// </summary>
        public dynamic Min
        {
            get { return _min; }
            set { SetProperty(ref _min, value); }
        }
        /// <summary>
        /// 最大值
        /// </summary>
        public dynamic Max
        {
            get { return _max; }
            set { SetProperty(ref _max, value); }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            get { return _remark; }
            set { SetProperty(ref _remark, value); }
        }
    }
}